<template>
  <div>
    御剑乘风来,除魔天地间!
    <div v-if="flag"> <input @blur="flag = !flag" v-focus type="text"> </div>
    <div v-else><button @click="btn">点我</button></div>
    
  </div>
</template>
<script>
export default {
  name: 'MyTag',
  directives:{
    focus:{
      inserted(el){
        el.focus()
      }
    }
  },
  data () {
    return {
      flag:false
    }
  },
  created () {
  },
  computed: {
  },
  methods: {
    btn(){
      this.flag=!this.flag
    }
  }
}
</script>
<style lang='less'  scoped>
</style>
